<?php
namespace App\Http\Controllers\Login;
use App\Http\Controllers\Controller;
use App\Models\OrderModels\Order;
use Illuminate\Http\Request;
use App\Http\Controllers\ApiBaseController;
class OrderController extends ApiBaseController{
	function __construct(Request $request) {
		parent::__construct($request);
	}
	
	//订单展示列表
	function dataList(){
		$dataOrder = new Order();
		$result = $dataOrder->getPageData($this->params);
		echo json_encode($result);
	}
	
	
	//订单列表
	function listOrder(){
		return view('/login/order/order',['personal_list_order'=>true]);
	}
	
	//订单详情页面
	function view($id){
		$config=Config('basics');
		if(intval($id)>0){
			$order=new Order();
			$data=$order->orderOne(array('id'=>$id));
			$data['type']=$config['type'][$data['type']];
			$data['status']=$config['pay_status'][$data['status']];
			$data['pay_type']=$config['pay_type'][$data['pay_type']];
			// echo "<pre>";print_r($data);exit();
			return view('login/order/view',['personal_list_order'=>true,'data'=>$data]);
		}
		abort(404);
	}
	
	//金额变动记录
	function priceList(){
		return view('/login/order/list',['price_list_info'=>true]);
	}
	
	//金额变动列表拉取
	function infoList(){
		$dataOrder = new Order();
		$result = $dataOrder->getPageDataList($this->params);
		echo json_encode($result);
	}
}